@layout("/common/_container.html",{js:["/assets/order/orderPut/query.js"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">Inbound Order Management</span>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md12 layui-col-lg12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item">
		                    <div class="layui-inline">
		                        <input id="condition" class="layui-input" type="text" placeholder="Keywords"/>
		                    </div>
		                    <div class="layui-inline">
		                        <select id="billstate">
		                            <option value="">Select Status</option>
						            <option value="PENDING_INBOUND">PENDING_INBOUND</option>
						            <option value="WAREHOUSED">WAREHOUSED</option>
						            <option value="WITHDRAWN">WITHDRAWN</option>
						            <option value="CANCELLED">CANCELLED</option>
		                        </select>
		                    </div>
		                    <div class="layui-inline">
								<select id="putCustomerId">
					            	<option value="">Select Customer</option>
						            @for(item in customerlist!){
						            <option value="${item.id}">${item.customerName}</option>
						            @}
					        	</select>
		                    </div>
		                    <div class="layui-inline">
								<select id="warehouseId">
					            	<option value="">Select Warehouse</option>
						            @for(item in basicWarehouseList!){
						            <option value="${item.id}">${item.warehouseName}</option>
						            @}
					        	</select>
		                    </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="startTime" class="layui-input" autocomplete="off" type="text" placeholder="Order Date From"/>
		                    </div>
                            <div class="layui-inline">
                            	to
                            </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="endTime" class="layui-input" autocomplete="off" type="text" placeholder="Order Date To"/>
		                    </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="startTime2" class="layui-input" autocomplete="off" type="text" placeholder="Completion Date From"/>
		                    </div>
                            <div class="layui-inline">
                            	to
                            </div>
		                    <div class="layui-inline" style="width: 150px;">
		                        <input id="endTime2" class="layui-input" autocomplete="off" type="text" placeholder="Completion Date To"/>
		                    </div>
		                    <div class="layui-inline">
		                        <button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>Search</button>
								@if(shiro.hasPermission("/orderPut/export")){
									<button id="btnExp" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>Export</button>
									<button id="btnExpBySpec" class="layui-btn icon-btn"><i class="layui-icon">&#xe67d;</i>Export XLSX by Conditions</button>
								@}
								<!-- <button id="btnLaunch" class="layui-btn layui-btn-normal"><i class="layui-icon">&#xe642;</i>批量发起</button> -->
		                    </div>
		                </div>
		            </div>
                    <table class="layui-table" id="orderPutTable" lay-filter="orderPutTable"></table>
                    <table class="layui-table" id="orderPutDetailedTable" lay-filter="orderPutDetailedTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>
<input id="putDetailedNumber" type="hidden">

<script type="text/html" id="toolbarfromDetailed">
            <div class="layui-inline">
                <input id="condition2" class="layui-input" type="text" placeholder="Product Name, Code, SKU No."/>
            </div>
            <div class="layui-inline">
                <button id="btnSearchDetailed" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>Search</button>
            </div>
</script>
<script type="text/html" id="billstateTpl">
  {{#  if(d.billstate === 'Cancelled'){ }}
    <span style="color: #FF4500;font-weight: 600;">{{ d.billstate }}</span>
  {{#  }else if(d.billstate === 'Pending Inbound'){ }}
    <span style="color: #FFC300;font-weight: 600;">{{ d.billstate }}</span>
  {{#  }else if(d.billstate === 'Inbound Completed'){ }}
    <span style="color: #43CF7C;font-weight: 600;">{{ d.billstate }}</span>
  {{#  } else { }}
    {{ d.billstate }}
  {{#  } }}
</script>


<script type="text/html" id="tableBar">
    {{#  if(d.billstate === 'Cancelled' ){ }}
    	<a class="layui-btn layui-btn-normal layui-btn-xs" style="font-size: 7px;" lay-event="launch" id="launch">Launch</a>
    {{#  }else if(d.billstate === 'Pending Inbound' || d.billstate === 'Inbound Completed'){ }}
    	<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="revoke" id="revoke">Withdraw</a>
    {{#   } }}
</script>
@}